﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CC.MVC.Models
{

    /// <summary>
    /// This is the basis for all objects
    /// </summary>
    public abstract class Shape
    {
        /// <summary>
        /// This is the first demension of the object.
        /// </summary>
        public double X { get; set; }

        /// <summary>
        /// This is the second demension of the object.
        /// </summary>
        public double? Y { get; set; }

        /// <summary>
        /// This is the third demension of the object.
        /// </summary>
        public double? Z { get; set; }

        /// <summary>
        /// All child objects MUST override this function and give it its own implementation.
        /// </summary>
        /// <returns></returns>
        public abstract double GetArea();

        //Single parameter constructor
        public Shape(double x)
        {
            this.X = x;
        }

        //Double parameter constructor - Calls the single parameter constructor after this executes
        public Shape(double x, double y)
            : this(x)
        {
            this.Y = y;

        }

        //Triple parameter constructor - Calls the double parameter constructor after this executes
        public Shape(double x, double y, double z)
            : this(x, y)
        {
            this.Z = z;
        }
    }
}
